package com.itany.shop.rowmapper;

import com.itany.shop.entity.User;
import com.itany.shop.util.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @author MissChen
 * @date 2024年03月29日 10:27
 */
public class UserRowMapper implements RowMapper<User> {

    @Override
    public User mapRow(ResultSet rs) throws SQLException {
        User user=new User();
        user.setId(rs.getInt("id"));
        user.setUsername(rs.getString("username"));
        user.setPassword(rs.getString("password"));
        user.setPhone(rs.getString("phone"));
        user.setAddress(rs.getString("address"));
        return user;
    }
}
